package com.test.study.shiro_demo.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

  @RequiresPermissions("user:del")
  @RequestMapping("/delete")
    public  String userDel(){
      System.out.println("user删除方法！");
        return "user删除成功！";
    }
    @RequiresPermissions("user:add")
    @RequestMapping("/add")
    public  String userAdd(){
        System.out.println("user增加方法！");
        return "user增加成功！";
    }
    @RequiresPermissions("user:upd")
    @RequestMapping("/update")
    public  String userUpdate(){
        System.out.println("user更新方法");
        return "user更新成功！";
    }
    @RequiresPermissions("user:sel")
    @RequestMapping("/select")
    public String userSelect(){
        System.out.println("user查询方法");
        return "查询成功！";
    }
}
